package com.gusti.common.controller.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.gusti.common.controller.ICommonController;
import com.gusti.common.services.ICommonServices;
import com.gusti.common.util.CommonResponse;

/**
 * 
 * @author gusti
 *
 */
@Controller
public class CommonController implements ICommonController {

	@Autowired
	ICommonServices commonServices;

	@RequestMapping(value = "/", method = RequestMethod.GET)
	@ResponseBody
	public String getResponse(){
		
		return "hello";
	}

	@RequestMapping(value = "/{path}", method = RequestMethod.GET)
	@ResponseBody
	public CommonResponse getResponse( @PathVariable("path") String path ){

		return commonServices.getResponse( path );
	}
	
}
